package com.gxsyh.nantie.order.provider.service.impl;

import com.gxsyh.nantie.order.provider.domain.TbDepartmentSubsidyUpdateTime;

import javax.annotation.Resource;
import com.gxsyh.nantie.order.provider.mapper.TbDepartmentSubsidyUpdateTimeMapper;
import com.gxsyh.nantie.order.provider.TbDepartmentSubsidyUpdateTimeService;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.transaction.annotation.Transactional;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

/**
 * @email yom535@outlook.com
 * @author: 刘锋嘉(Liu Fengjia)
 * @date: 2020/2/17
 * @time: 16:10
 * @Description: 
 */
@Transactional
@Service(version = "1.0.0")
public class TbDepartmentSubsidyUpdateTimeServiceImpl implements TbDepartmentSubsidyUpdateTimeService{

    @Resource
    private TbDepartmentSubsidyUpdateTimeMapper tbDepartmentSubsidyUpdateTimeMapper;

    @Override
    public int selectSubsidyUpdateTime(Long departmentId) {
        Example example=new Example(TbDepartmentSubsidyUpdateTime.class);
        example.createCriteria().andEqualTo("departmentId",departmentId);
        TbDepartmentSubsidyUpdateTime tbDepartmentSubsidyUpdateTime = tbDepartmentSubsidyUpdateTimeMapper.selectOneByExample(example);
        String updateTimed=(String) tbDepartmentSubsidyUpdateTime.getSubsidyUpdateTime().subSequence(0,2);
        return Integer.valueOf(updateTimed);
    }
}
